package cn.bone.spring.jms01;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import org.springframework.stereotype.Service;

import javax.jms.Destination;
import javax.jms.MessageListener;

/**
 * Created by MD-01 on 2017/1/12.
 */
@Service
public class CommonJMS {

    @Autowired
    private JmsTemplate template;

    public void send(final Destination destination,
                     final MessageCreator messageCreator){
        template.send(destination, messageCreator);
        template.receiveAndConvert(destination);


    }
}
